home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / vcntpr.zip / VCNTREVG.TXT < prev   
Text File  |  1993-07-29  |  74KB  |  1,130 lines

  1.  
  2.  
  3.  
  4.  
  5. Microsoft* Visual C++*
  6. Development System Version 1.0 for Windows* and Windows NT*
  7.  
  8. Product Overview
  9.  
  10. July 1993
  11.  
  12.  
  13. For more information contact:
  14.  
  15. Microsoft Corporation
  16. Eric Lang, (206) 882-8080
  17.  
  18. Waggener Edstrom
  19. Martin Middlewood, (503) 245-0905
  20.  
  21.  
  22.  
  23. Table of Contents
  24.  
  25. Introduction    1
  26. Design Goals of Visual C++ Standard and Professional Editions    1
  27. Visual C++ Standard and Professional Editions Deliver    1
  28. WhatÆs New For The 32-bit Edition    2
  29. Visual C++ 32-bit Edition Delivers    2
  30. Shortest Path to 32-bit Windows    3
  31. Safest Investment - Still    4
  32. Moving to 32-bit C++ Programming in Windows    6
  33. Key Points    12
  34. Executable Size and Speed Improvements    13
  35. Smart Linking    13
  36. New optimizations for Pentium and i486 Processors    13
  37. Simpler Compiler Switches    13
  38. 32-bit Programming    13
  39. Long-term Investment    14
  40. Support    14
  41. Appendix A:  List of Features    A-1
  42. Visual Workbench    A-1
  43. App Studio    A-2
  44. AppWizard    A-3
  45. ClassWizard    A-3
  46. Microsoft Foundation Class Library Version 2.0    A-4
  47. Compatibility of Visual C++ with Existing Tools    A-6
  48. Spy++ Analysis Tool    A-7
  49. Technical Support for Developers    A-8
  50. Product Target    A-9
  51. Availability, Pricing and Requirements    A-10
  52. Appendix B:  An Exercise with Visual C++    B-1
  53.  
  54.  
  55. Introduction
  56. Microsoft* Visual C++* Development System version 1.0 for Windows* and Windows NT*, 
  57. 32-bit Edition is the latest generation of C++ products from Microsoft that significantly shortens 
  58. the path to writing C++ applications for the Microsoft Windows operating system.  Visual C++ 
  59. 32-bit Edition does this by offering an integrated, task-oriented and 100-percent Windows NT 
  60. operating system-hosted graphical environment that provides significant productivity benefits and 
  61. ease of use with complete access to the power of C++.
  62. Design Goals of Visual C++ Standard and Professional Editions
  63. Visual C++ Standard and Professional Editions were introduced in February 1993 for use with the 
  64. Windows operating system version 3.1.
  65. The major design goals of Microsoft Visual C++ Standard and Professional Editions centered 
  66. around providing solutions to specific needs that had been identified by the developer community 
  67. in extensive research.  Specifically, Visual C++ was created to be the shortest path to C++ 
  68. programs for Windows.  Ease of use was the number one design goal.  Additionally, customers 
  69. wanted a development tool that protects their investment in learning the tool, as well as their 
  70. application source code.  Visual C++ was designed to accomplish this while providing the 
  71. smallest and fastest executables in the industry.  
  72. Visual C++ Standard and Professional Editions Deliver
  73. Visual C++ Standard and Professional Editions deliver comprehensive solutions to these problems.  
  74.     *    Shortest path to C++ Programs for Windows.  A completely new integrated graphical 
  75. tool set, including the Visual Workbench, a combined editor, debugger, graphical browser 
  76. and a project management system designed to be intuitive allowed programmers to easily 
  77. control project options for the compiler and linker.  All options can easily be set through 
  78. dialog boxes.  Extensive online help facilities were also provided.
  79.         Two wizards, the App Wizard and Class Wizard, combine to assist the developer in 
  80. setting up new projects and in managing the derivation of classes from the MFC 2.0 
  81. application framework.  Developers can work with the application framework to 
  82. create new classes and member functions, allowing Class Wizard to manage the 
  83. mundane details of hooking the new classes up to user interface components.
  84.         App Studio is a completely integrated resource editor that combines new visual 
  85. editors for all of the standard Windows resources into one easy-to-use tool featuring 
  86. drag-and-drop and point-and-click simplicity.  The streamlined integration with Visual 
  87. Workbench and Class Wizard make it the easiest way to connect user interface 
  88. elements to C++ classes and application code.
  89.     *    Safest Investment.  Microsoft Foundation Class (MFC) 2.0 improves upon the popular 
  90. C++ development set for Windows with the Microsoft Foundation Class Library 1.0.  
  91. Applications written using MFC 1.0 move easily to MFC 2.0 to take advantage of the 
  92. new high level features.  The new library provides architecture classes and classes for 
  93. advanced features such as Toolbars, Status Bars, Printing and Print Preview, Splitter 
  94. Windows and more.  
  95.         In addition, MFC was designed to coexist with existing C and C++ code so that 
  96. developers can add new features to existing applications without having to completely 
  97. rewrite them.
  98.     *    Smallest and Fastest Code.  Building on the legacy of code generation quality set 
  99. with previous versions of Microsoft compilers, the optimization technology in Visual 
  100. C++ Professional Edition is second to none, providing highly tuned applications with 
  101. unlimited flexibility.  The developer controls exactly which optimizations are used.  
  102. Visual C++ Professional Edition also added new switches to automatically create 
  103. either the smallest, or the fastest executable, avoiding the complications of custom 
  104. optimizations where such fine control is not necessary.
  105.         The entire Visual C++ family is the result of listening to the concerns of developer 
  106. customers.  Making C++ and programming for Windows easy is the number one 
  107. concern.  All versions of Visual C++ have been designed with these goals in mind.  
  108. WhatÆs New For The 32-bit Edition
  109. Visual C++ 32-bit Edition version 1.0, formally announced in August 1993, includes SDK tools and 
  110. advanced optimizations for the Win32* and Win32s* application program interface (API) and is 
  111. designed to be hosted under the Windows NT operating system.  Like the other Visual C++ 
  112. editions, the 32-bit Edition was designed with specific customer-driven design goals.  The specific 
  113. design goals for the 32-bit Edition include the following:
  114.     *    Shortest Path to 32-bit Windows.  Bringing the ease-of-use features from the 16-bit 
  115. product to 32-bits was crucial.  Streamlined integration and wizards can be used to 
  116. assist the developer in creating powerful 32-bit applications for both Windows NT and 
  117. Windows 3.1.  The power of the Windows NT host operating system can be exploited 
  118. to allow seamless background compilation and simultaneous multiple project builds.  In 
  119. addition, the developer is assisted in all phases of 32-bit development, from project 
  120. creation to debugging. 
  121.     *    Safest Investment.  Visual C++ 32-bit Edition is the safest investment in C++ 
  122. development tool technology because it provides an easy 16-bit to 32-bit migration 
  123. path from previous Microsoft C++ products.  It enables developers to use existing 
  124. NMAKE files, and to work with existing C and C++-based projects.  Visual C++ 
  125. 32-bit provides a way for developers to write applications from a single source code 
  126. base that will run on both Windows 3.1 and the new Windows NT operating system, 
  127. taking advantage of the performance benefits of 32-bit programming on both 
  128. platforms.
  129. Visual C++ 32-bit Edition Delivers
  130. Visual C++ 32-bit Edition is the latest addition to the Visual C++ family.  It delivers on each of 
  131. these objectives.  Visual C++ 32-bit Edition uniquely addresses these objectives by providing the 
  132. ease-of-use features introduced in the Standard and Professional Editions, and incorporating 
  133. enhancements for support of 32-bit programming and the Windows NT host platform.
  134.  
  135.  
  136. Shortest Path to 32-bit Windows
  137.     *    IDE Enhancements.  The Visual Workbench and integrated debugger have been 
  138. enhanced with new features for 32-bit programming while providing the same intuitive 
  139. interface as the 16-bit products.  Developers already familiar with Visual C++ Standard 
  140. or Professional Editions will be right at home working with the new 32-bit edition.  
  141. However, to improve on the ease of use, we added several new enhancements, including 
  142. the following:
  143.     -    IDE is a completely 32-bit application itself and takes advantage of the advanced 
  144. features of the Windows NT operating system, including preemptive multitasking 
  145. and multithreading.  This allows the developer to continue working in project 
  146. files while builds are progressing in the background.  Additionally, it is possible 
  147. to have multiple builds occurring simultaneously.
  148.     -    Integrated Profiler makes profiling just a few mouse clicks away.  It has 
  149. tremendous improvement in its ease of use and enables developers to see 
  150. potential performance problem areas in their code at a glance. 
  151.     -    Find-in-files utility allows global searching through source files for any text 
  152. string.  The integration of this feature allows the developer to go directly to the 
  153. place in the source code the references are found by simply clicking the result in 
  154. the output window.  This is just one of many ways that the Visual Workbench 
  155. allows virtually unlimited navigation of complex project files, dramatically 
  156. improving programmer productivity when navigating through the Win32 API.  
  157.     -    Enhanced support for third-party tool integration - tools can now direct their 
  158. output to the IDE output window.  Tools can easily be added to the Tools menu 
  159. for easy access.  Again, the improved integration provides a more seamless 
  160. environment for the developer, making it much easier to take advantage of 
  161. capabilities offered by third-party tools.
  162.     *    Debugger Enhancements.  The IDE debugger in Visual C++, 32-Bit Edition, has 
  163. been enhanced with the features developers have asked for most.  In addition to all of 
  164. the features included in the Standard and Professional Editions, the 32-bit Edition 
  165. includes the following:
  166.     -    New memory window - displays current memory contents.
  167.     -    Support for Structured Exception Handling - allows the developer to control 
  168. the action of the debugger when an exception is thrown.  Options include stop if 
  169. unhandled, and stop always.  User defined exceptions can be created.  This 
  170. configurability allows the developer greater control of the application during the 
  171. debugging stage, and assists in locating coding errors.
  172.     -    Support for threads - allows the developer to view the current execution state 
  173. of all threads in the target application, pause or resume thread execution, view 
  174. addresses or functions and begin additional debugging tasks such as obtaining a 
  175. stack trace.  Double clicking opens the appropriate source file and positions the 
  176. highlight on the line of execution.  This can dramatically ease the task of 
  177. debugging a multithreaded application because it is possible to easily follow the 
  178. execution path of any given thread.
  179.     *    New Spy++ Windows Analysis Tool.  Spy++ is the greatly enhanced window message 
  180. spy utility for Visual C++ 32-bit Edition that allows a developer to quickly discover a 
  181. great deal of information about his or her Windows-based application.  The display of 
  182. window messages now shows decoded parameters as well as return values.  Flexible 
  183. "filters" allow precise control over the messages, windows and other information 
  184. displayed.  In addition to the view that shows the messages going to a window, three 
  185. different "Tree" view types show the hierarchical relationships of windows, processes 
  186. and threads in the system.  Four other "Detail" view types show details about specific 
  187. windows, processes, threads and window classes in the system.  Any number of these 
  188. different views can be displayed at once.  Links are used throughout the Spy++ views to 
  189. allow a developer to quickly get more information about the items that are shown.
  190.     *    Compiler Enhancements.  The Visual C++ 32-bit Edition compiler is a proven 
  191. technology.  More than 100 million lines of code were run through this compiler 
  192. during the development process.  In fact, it is the compiler that was used to build 
  193. Windows NT itself.  New code generation for i486* and Pentium* processors, 
  194. coupled with advanced optimization for the new Pentium superscalar architecture, 
  195. assures the fastest and smallest code possible for the highest performing application.  
  196. Microsoft worked closely with Intel in implementing this advanced optimization 
  197. technology.  The new i486 and Pentium optimizations offer dramatic performance 
  198. improvements for target applications.
  199.         The 32-bit Edition also continues support for precompiled headers, and all compiler 
  200. options can be easily controlled from the Visual Workbench.
  201. Safest Investment - Still
  202.     *    MFC 2.0.  The Microsoft Foundation Class Library 1.0 became a standard for C++ 
  203. application development for Windows.  Microsoft committed to ensuring that 
  204. applications written to the MFC standard would move forward to our newer operating 
  205. systems.  MFC 1.0 has been shipping with the Win32 prerelease SDK, and many 32-bit 
  206. applications have been written using it.  MFC 2.0 builds on the foundation established 
  207. with MFC 1.0 by adding architecture classes and classes for such advanced user interface 
  208. features as Splitter Windows, Toolbars, Status Bars, Printing and Print Preview and 
  209. more.  Applications written using MFC 1.0 can easily be moved to MFC 2.0, preserving 
  210. the developerÆs investment.  
  211.         Now, 16-bit applications written using either MFC 1.0 or MFC 2.0 can easily be 
  212. moved to 32-bits, providing improved application performance.  The resulting 32-bit 
  213. application can run on Windows 3.1 or Windows NT, allowing developers to 
  214. maintain a single source code base for both operating systems.
  215.     *    Windows 3.1 Targetting.  The Visual C++ 32-bit Edition includes the Win32 SDK 
  216. components necessary for building applications for Windows NT.  It also includes 
  217. Win32s, a product that allows 32-bit Win32-based applications to run binary-compatibly 
  218. under both Windows NT and Windows operating system version 3.1.  By writing 
  219. applications to the Win32 API using Win32s, developers can create single source base 
  220. 32-bit applications that will run on both Windows 3.1 and Windows NT.  Because of the 
  221. flat address model of 32-bit programming, it is often easier to write 32-bit applications, 
  222. and these applications often will run faster than comparable 16-bit applications, even 
  223. when running on Windows 3.1.  
  224.         Win32s is a complete development solution, including a debugger and command line 
  225. tools that operate on the Windows 3.1 target.  A developer can edit, build and debug 
  226. the application under Windows NT, and then move the source code to a Windows 3.1 
  227. target for final performance tuning and debugging.  
  228.         Applications written using MFC 2.0 are fully compatible with Win32s.
  229.  
  230.  
  231.     *    Exploits CD-ROM with Books Online.  Visual C++ 32-bit Edition is the first PC based 
  232. development tool to fully exploit the power of CD-ROM media.  In addition to the 
  233. software and online help, more than 10,000 pages of documentation has been cross 
  234. referenced and indexed into a new Books Online system.  Developers have instant access 
  235. to the usersÆ guides, tutorials, language references and API references.  The new viewer 
  236. technology shipped with Visual C++ 32-bit Edition includes extensive browsing 
  237. capabilities and an enhanced full-text search feature so that even topics that cannot be 
  238. found through the extensive indexing can easily be found using wild cards, pattern 
  239. matching, etc.  Books Online includes all of the graphics and source code samples in the 
  240. available printed documentation and is truly information at your fingertips.
  241. For those developers who also wish printed documentation, it can be obtained at additional cost.
  242.  
  243. Figure 1
  244.  
  245. Visual C++ 32-bit edition, also allows developers to run the development environment directly from 
  246. the CD-ROM, saving up to 75 megabytes of hard disk space for developers who use this option.  
  247. As summarized in the chart below, Visual C++, 32-Bit Edition is the product to choose if you 
  248. wish to create powerful 32-bit applications for Windows 3.1 and Windows NT.
  249.  
  250. Visual C++ 
  251. Standard Edition
  252. Visual C++ 
  253. Professional Edition
  254. Visual C++
  255. 32-bit Edition
  256.  
  257. Hosted on
  258. Windows 3.1
  259. Windows 3.1
  260. Windows NT
  261.  
  262. Targets
  263. Windows 3.1 (Win 16)
  264. Windows 3.1 (Win 16)
  265. MS-DOS* (DOS 16)
  266. Windows 3.1 (Win32s)
  267. Windows NT (Win32)
  268.  
  269.  
  270.  
  271. Moving to 32-bit C++ Programming in Windows
  272. As mentioned above, the difficulty of moving to C++ programming in the Windows environment 
  273. is a major issue for developers.  The fastest way to show how the Visual C++ development 
  274. system helps programmers overcome these difficulties is to briefly describe the process needed to 
  275. create a new application that uses the new features of Microsoft Foundation Class version 2.0.
  276. In the next few pages, a series of steps demonstrate how Visual C++ 32-Bit Edition can speed the 
  277. development of 32-bit C++ applications for the Windows or Windows NT environments.  An 
  278. overview of these steps are as follows:
  279. 1.    Visual Workbench:  Starts the integrated development environment. 
  280. 2.    AppWizard:  Creates a new "skeleton" application that supports Microsoft Foundation 
  281. Class 2.0.
  282. 3.    App Studio:  Creates, edits and browses application resources.
  283. 4.    ClassWizard:  Connects user interface elements to C++ code.
  284. 5.    Microsoft Foundation Class 2.0:  Leverages the architecture and high-level abstractions of 
  285. the application framework.
  286. 6.    Visual Workbench:  Builds and debugs the application.
  287. The following "demo" covers only a few of the more important features.  For a more 
  288. comprehensive discussion of the features of Visual C++, see Appendix A.  For an actual 
  289. programming exercise, see Appendix B. 
  290. Step 1:  Start Visual Workbench
  291. Double-clicking the Visual Workbench icon launches the Visual C++ completely new, 100-percent 
  292. Windows-hosted development environment.  Visual Workbench is a fully integrated environment 
  293. that enables programmers to edit, build, debug and browse program code in a visually oriented 
  294. manner.  It includes a source code editor, compiler/linker, debugger and class browser.
  295. Visual Workbench also provides completely seamless access to all other Visual C++ tools, 
  296. including App Studio for resource editing and ClassWizard for connecting user interface elements 
  297. to application code.
  298. Visual Workbench allows programmers to build or edit code in the background.  For example, 
  299. you can click the build button to compile and link your application and then use the editor to write 
  300. a new function while the build is completed as a background task.
  301.  
  302. Figure 2.  Visual Workbench
  303. Step 2:  AppWizard
  304. To create a new application, you select AppWizard from the Visual Workbench Project menu.  
  305. The purpose of AppWizard is to create a full set of "skeleton" application source code files and 
  306. project files that give programmers a "jump start" into programming with Visual C++ using 
  307. Microsoft Foundation Class 2.0.  By clicking check boxes in an AppWizard dialog (see figure 
  308. three), you can choose which Microsoft Foundation Class 2.0 features you want the application to 
  309. contain, including:
  310.     *    Print and Print Preview
  311.     *    Multiple document interface (MDI) support
  312.     *    OLE client support
  313.     *    Context-sensitive Help
  314.     *    Toolbar capabilities
  315.  
  316. The key productivity benefit of AppWizard is that it reuses a substantial amount of prefabricated 
  317. code in the application framework.  All the initial source code for the selected features is included in 
  318. the applicationÆs project files.  It takes only a few seconds to create the skeleton application, which 
  319. you can build and run immediately.  Because so much functionality is included, creating the skeleton 
  320. application manually would have taken considerably longer. 
  321. Additionally, the application automatically supports the new Microsoft Foundation Class 2.0 
  322. document and view architecture (described in Appendix A and the Microsoft Foundation Class 2.0 
  323. white paper).
  324. AppWizard is therefore the fastest way to get started with Microsoft Foundation Class 2.0 
  325. programming because it creates baseline Microsoft Foundation Class 2.0 source code that 
  326. programmers can extend or modify.
  327.  
  328. Figure 3.  AppWizard Options Dialog
  329. Step 3:  App Studio
  330. Once the initial program files are created, you can use App Studio to edit all the resources associated 
  331. with the project.  Accessed from the Visual Workbench Tools menu, App Studio is a Windows-
  332. hosted program that provides a graphical and interactive approach to designing user interfaces and 
  333. editing resources of Windows applications.
  334. App Studio includes editors for:
  335.     *    Application menus
  336.     *    Dialogs and forms
  337.     *    Bitmaps, cursors and icons
  338.     *    String table entries
  339.     *    Accelerator tables
  340.  
  341. Editing your applicationÆs user interface in App Studio is similar to drawing your interface in the 
  342. Visual Basic programming system.  In addition to letting you draw menus and dialogs, App studio 
  343. also supports drawing bitmaps, icons and cursors.  App Studio lets you open multiple resource files 
  344. and drag and drop resources between them.  It is 100 percent compatible with the Microsoft 
  345. Resource Compiler * allowing you to edit resources for both C and C++ applications.  And it is 
  346. fully integrated with Class Wizard and the Visual Workbench so that you can draw user interface 
  347. objects and connect them to code quickly and error free.  In total, App Studio provides a completely 
  348. integrated user interface editor to make drawing and coding user interfaces easy and efficient.
  349.  
  350.  
  351. The following diagram shows a simple dialog being edited with the App Studio dialog editor:
  352.  
  353. Figure 4.  App Studio
  354. Step 4:  ClassWizard
  355. While working with resources in App Studio, the next step is to run ClassWizard, which you select 
  356. from the App Studio toolbar.  ClassWizard allows you to quickly connect the components of your 
  357. programÆs user interface (menus, dialogs, etc.) to the code that handles them.  ClassWizard is 
  358. important because it allows you to browse and change messages, message-handler functions and 
  359. member variables many times faster (and with fewer errors) than would otherwise be possible 
  360. manually.
  361. Once inside ClassWizard (see the following figure), you can select which messages from 
  362. Windows the resource will respond to, and enter the names of functions that will handle the 
  363. messages.  ClassWizard updates the appropriate header files with all the necessary variable and 
  364. function declarations.  It also adds "empty" function definitions in the implementation files, along 
  365. with comments to help you understand what code you need to add.  At any time, you can jump 
  366. directly to these functions in your source code by clicking the Edit Code button.  You can also 
  367. press F1 on a Windows message to display a Help screen on that message.
  368. When relationships between a programÆs user interface and its code change, you can use ClassWizard 
  369. to automatically edit the class members, message maps or dialog data macros within the source files to 
  370. keep them consistent.  However, ClassWizard is completely noninvasive; it never changes any code 
  371. you write and is therefore completely safe.  ClassWizard only does exactly what you tell it to do.
  372. Class Wizard also allows you to set up and manage the new dynamic dialog data exchange and 
  373. validation (DDX/DDV) capabilities of the application framework.  DDX/DDV is a capability that 
  374. allows data values entered into an application dialog to be automatically validated and assigned to 
  375. member variables at run time.
  376.  
  377. Figure 5.  ClassWizard
  378. Step 5:  Implementation with Microsoft Foundation Class 2.0
  379. At this point, a complete skeleton application with all the appropriate resources and declarations 
  380. has been built interactively and without any programming.  The next step is to use the integrated 
  381. Visual Workbench editor to complete the function implementations that respond to user 
  382. interaction and add any other code necessary to complete the application.
  383. To do this, you can use the Microsoft Foundation Class 2.0 library, an application framework 
  384. built on the core set of functionality in Microsoft Foundation Class 1.0.  Microsoft Foundation 
  385. Class 2.0 provides an architecture and a set of prebuilt components that significantly simplify 
  386. programming for Windows in C++.  It offers a high level of abstraction that lets you focus on the 
  387. details specific to your application, while simultaneously providing access to lower-level classes 
  388. and the native Windows API for maximum flexibility and power.
  389. Microsoft Foundation Class 2.0 offers more than one hundred reusable and extensible C++ 
  390. classes, many of which already encapsulate the basic building blocks of a professional application 
  391. written for the Windows environment.  For example, to add a toolbar to an application requires 
  392. fewer than 10 lines of code, but this represents more than 1,500 lines of Microsoft Foundation 
  393. Class 2.0 framework code.  Similarly, adding printing and print preview capability can be done in 
  394. just a few minutes, but represents several thousand lines of framework code.
  395. Because Microsoft Foundation Class 2.0 code can be intermixed with native Win32 or Win32s 
  396. SDK calls, programmers can migrate existing 32-bit Windows-based applications to C++ at their 
  397. own speed.  Additionally, the Microsoft Foundation Class 2.0 code is completely portable 
  398. between 16-bit and 32-bit Windows.  
  399. Step 6:  Build and Debug With Visual Workbench
  400. After the appropriate functions have been implemented, you can build your application by clicking 
  401. the Build button on the Visual Workbench toolbar.  The Visual C++ compiler offers all the size 
  402. and speed benefits of the C/C++ 7.0 compiler, and adds additional features (see size and speed 
  403. improvements section).  As a result, Visual C++ produces executable files that are still among the 
  404. fastest and smallest in the industry.
  405. Visual Workbench can automatically create and maintain build options in its own makefiles, or 
  406. you can use existing project files, which are 100-percent compatible with the NMAKE command-
  407. line tool from the Microsoft C/C++ development system version 7.0 and from the Win32pre-
  408. release SDK.  You can use existing makefiles from C/C++ 7.0 or the Win32 pre-release SDK if 
  409. you want to use special build rules or to invoke command-line tools.
  410. You then debug your application using the Visual C++ debugger, a completely new Windows-
  411. hosted debugger that is fully integrated with the Visual Workbench.
  412.  
  413. Figure 6.  Debugger Breakpoints Dialog
  414.  
  415. To set a breakpoint, select a line of source code in the editor and click the breakpoint button on 
  416. the Visual Workbench toolbar.  You can edit source code or set new breakpoints while you 
  417. debug, or vice versa.
  418.  
  419.  
  420. Key Points
  421. The product overview previously discussed demonstrates the following key points about the design 
  422. of Visual C++:
  423.     *    Delivers the benefits of Visual Basic to programmers using C++.  Visual C++ 
  424. offers many of the ease-of-use and productivity benefits associated with the 
  425. Visual Basic* programming system while providing complete access to the power of 
  426. C++ for programming in Windows.
  427.     *    Highly integrated tool set.  Visual C++ provides a highly integrated tool set that 
  428. makes the development cycle more efficient from start to finish.  This integration 
  429. allows programmers to switch rapidly between distinct tasks such as editing, building 
  430. and debugging, or to even do some of these tasks concurrently.
  431.     *    Full-featured applications with less work.  Through Microsoft Foundation Class 2.0, 
  432. programmers can build better applications in a fraction of the time that it takes using C 
  433. and the Win32 or Win32s SDKs.  This is because the Microsoft Foundation Class 
  434. Library 2.0 contains a large amount of reusable code, high-level abstractions and 
  435. "canned" functionality that programmers can add to their applications with very little 
  436. effort.  
  437.     *    Easy to learn.  Its graphical and visual nature helps make Visual C++ easy to 
  438. learn.  Since all of Visual C++ (including all the tools) are now 100-percent Windows 
  439. NT-based, all of the advantages of the Windows NT environment (rich user interface 
  440. graphics, consistent operation, multitasking, toolbars, floating palettes and so on) are 
  441. offered to programmers. Comprehensive product testing at MicrosoftÆs usability lab 
  442. helped to refine all aspects of the user interface and make it both fast and intuitive.  New 
  443. with Visual C++ 32-Bit edition is the extensive on-line documentation:  over 10,000 
  444. pages of documentation is included in browsable, cross-referenced, and hot-linked 
  445. Books Online form.  Printed documentation is also available.  Extensive sample code, 
  446. online help and product support are available to assist developers of all levels of 
  447. experience.
  448.     *    Easy migration path.  Microsoft Foundation Class 2.0 allows programmers to easily 
  449. migrate their existing C/Win32 SDK program code to C++.  Developers can freely mix 
  450. Microsoft Foundation Class 2.0 code with native Win32 SDK or Win32s SDK calls, 
  451. enabling programs to be gradually transitioned into C++ instead of rewriting them from 
  452. scratch.  Also, since the Microsoft Foundation Class 2.0 library follows function and 
  453. parameter naming conventions that closely match the Win32 SDK, a developerÆs 
  454. knowledge of programming for Windows NT is preserved.
  455.     *    Still the smallest and fastest executables files.  Visual C++ incorporates Microsoft 
  456. code optimization technology that is now in its fifth generation. All of the optimizations 
  457. of C/C++  7.0 and in the Win32 pre-release SDK compiler are available in Visual C++, 
  458. and a number of further improvements have been made, which are described below. In 
  459. short, executable files built with Visual C++ 32-Bit Edition are still the smallest and 
  460. fastest in the industry, and are smaller and faster than those built with any previous 
  461. Microsoft compiler.
  462. The remainder of this guide discusses additional improvements and features in greater detail.
  463.  
  464.  
  465. Executable Size and Speed Improvements
  466. All of the code optimizations of C/C++ 7.0 and the Win32 pre-release SDK compiler are available in 
  467. Visual C++ along with the additional improvements described below.  As a result, executable files 
  468. built with Visual C++ are still the smallest and fastest in the industry, and are even smaller and faster 
  469. than those built using C/C++ 7.0 - the compiler that set the standard for small and fast code. 
  470. Smart Linking
  471. Smart linking is a capability that can significantly reduce executable size by eliminating functions 
  472. that are not referenced in the program.  It is especially important for programs that use large code 
  473. libraries (such as C++ class libraries) because linking with libraries usually results in the 
  474. incorporation of a considerable number of unused functions.
  475. New optimizations for Pentium and i486 Processors
  476. The compiler generates code specifically for the 80386, 80486, or Pentium instruction sets, which 
  477. results in faster execution and smaller code.  Visual C++ 32-Bit Edition includes new optimization 
  478. specifically for Pentium and i486 processors.  These optimizations take advantage of the superscalar 
  479. architecture of the Pentium processor to deliver even faster application performance than ever 
  480. before.
  481. Simpler Compiler Switches
  482. A number of programmers asked Microsoft to incorporate two additional compiler switches, and 
  483. we have done so: /O1 and /O2. 
  484. The /O1 switch provides all the best optimizations for size, while the /O2 switch provides all the 
  485. best optimizations for speed.  These further simplify the selection of build options.
  486. Another improvement is the simplification of the process to create and use precompiled headers.  
  487. Now, by specifying the /YX switch, a precompiled header is automatically created if none existed, 
  488. and the file is automatically reused in subsequent builds.
  489. 32-bit Programming
  490. Microsoft Visual C++ 32-bit Edition is designed to write 32-bit applications for either Windows 3.1 
  491. or Windows NT.  32-Bit applications offer higher performance, and because of the flat 32-bit address 
  492. space, are often easier to program.  When writing 32-bit applications, developers need not worry 
  493. about various compiler memory models and segment sizes as they have had to with traditional 16-bit 
  494. development systems.
  495. Developers write 32-bit applications using the Win32 or Win32s API.  The Win32 API is the 
  496. complete 32-bit API for the Windows NT operating system.  It includes support for preemptive 
  497. multitasking, symmetric multiprocessing, bezier curves, security and more.  The Win32s API is a 
  498. subset of the Win32 API that allows applications to run binary-compatibly on Microsoft 
  499. Windows 3.1.  It is an operating system extension that allows Windows 3.1 to run Win32-based 
  500. applications.
  501.  
  502.  
  503. Win32s offers software developers the following:
  504.     *    A powerful 32-bit programming model for Windows 3.1, which is binary compatible 
  505. with Windows NT
  506.     *    The performance advantages of 32-bit mode
  507.     *    Win32 semantics for the API
  508.     *    A rich subset of the full Win32 API
  509.     *    The ability to ship Win32 applications today for Windows 3.1 and Windows NT
  510.  
  511. Win32s consists of a virtual device driver and a set of dynamic link libraries that extend Windows 
  512. 3.1 to support Win32 applications.  The Win32s files must be shipped with the Win32 application 
  513. and installed on the Windows 3.1 system.  Visual C++ 32-bit edition provides the Win32s binaries 
  514. and a setup program to install Win32s on a Windows 3.l system.   
  515. Long-term Investment
  516. Microsoft strives to make its family of language products a safe choice for long-term investment.  
  517. The Microsoft Foundation Classes have become widely used among ISVs and corporate 
  518. developers, and Microsoft has publicly stated its long-term commitment to MFC as the future 
  519. direction for Windows-based and Windows NT-based programming in C++.
  520. Microsoft Foundation Class 2.0 extends the Microsoft Foundation Class C 1.0 library so that the 
  521. investment in Microsoft Foundation Class 1.0 applications is preserved.  Microsoft Foundation 
  522. Class 1.0 programs need only be recompiled to begin taking advantage of Microsoft Foundation 
  523. Class 2.0.  Future versions of Microsoft Foundation Class will offer the same backward 
  524. compatibility so that programs written to previous Microsoft Foundation Class library versions 
  525. will be able to run without a problem.  Programmers can therefore incorporate new capabilities of 
  526. new Microsoft Foundation Class libraries at their own pace.
  527. Microsoft Foundation Class is also designed for compatibility with new versions of the Windows 
  528. operating system.  Applications written with the Microsoft Foundation Class 2.0 library on 
  529. Windows version 3.1 can be recompiled and run with no source code changes on Windows NT  
  530. operating system and Win32s API using Visual C++ 32-Bit edition.  
  531. Support
  532. Microsoft provides a wide range of support options for developers, including our product support 
  533. services, Microsoft Developer Network and CompuServe* forums.  This extensive support 
  534. network helps ensure that developers will be their most productive while using Visual C++.
  535. See Appendix A for more information on support services available from Microsoft.
  536.  
  537.  
  538. Appendix A:  List of Features
  539. Visual Workbench
  540. The Microsoft Visual C++ development system contains a completely new Windows-hosted 
  541. development environment called Visual Workbench.  Visual Workbench replaces the 
  542. ProgrammerÆs Workbench of previous Microsoft C versions.  Using Visual Workbench, 
  543. programmers can edit, build, debug and browse C/C++ code from a single integrated 
  544. Windows-based environment.  Visual Workbench also offers seamless access to AppWizard 
  545. for skeleton application generation, App Studio for creation and management of application 
  546. resources and ClassWizard for connecting code to resources.
  547. Features
  548.     *    Editor.  Windows-hosted.  By default, language keywords, identifiers, comments 
  549. and strings are displayed in different colors.  You can disable the colors entirely or 
  550. customize them to suit your own taste.  Visual C++ 32-Bit Edition includes a new 
  551. Find-in-files tool that allows global search through source files with many possible 
  552. options.
  553.     *    Debugger.  Fully Windows-hosted.  You can start the debugger from within the 
  554. Visual Workbench and use toolbar buttons to set or remove breakpoints and step 
  555. through the application source code.  Visual C++ 32-Bit Edition includes support 
  556. for Windows NT exceptions and threads, as well as a new memory window.
  557.     *    Class browser.  Windows-hosted, and can be used for both C and C++ code.  You 
  558. can now see graphical trees of class hierarchies and expand and collapse graphs by 
  559. clicking a mouse on icons that represent class "nodes."  This new method enables 
  560. programmers to browse the class hierarchy more quickly than before.  The browser 
  561. can also display the relationships between calling and called functions.
  562.     *    Improved ease of use.  Throughout its development, the Visual Workbench 
  563. designers refined the productÆs user interface by studying data from MicrosoftÆs 
  564. usability lab.  As a result, the Visual Workbench interface is intuitive and designed 
  565. to minimize the number of steps needed to perform each task, from editing 
  566. through debugging.
  567.     *    Seamless access to all tools.  All tools, including App Studio, AppWizard, 
  568. ClassWizard, the debugger, browser and editor can be accessed directly from Visual 
  569. Workbench.
  570.     *    Multiple document interface.  Allows you to simultaneously display the debugger, 
  571. source code windows, class browser information and status/error information. 
  572.     *    Toolbar.  One-click access to frequently used operations for file saving, text 
  573. finding/replacing, building, running and debugging.
  574.     *    Concurrent editing while building.  Allows programmers to edit source code 
  575. while they build.  For example, while a build occurs, a programmer can code a 
  576. new function that will be compiled and linked during the next build.
  577.     *    External makefile support.  Visual Workbench enables programmers to run 
  578. existing makefiles (called external makefiles) from within the Visual Workbench 
  579. environment.  In these cases, Visual Workbench does not alter the contents of the 
  580. makefile, but allows programmers to maintain the contents of the makefile outside 
  581. of the development environment.  If the external makefile generates output 
  582. compatible with CodeView*, the program can also be debugged from within 
  583. Visual Workbench.
  584. App Studio
  585. App Studio is a major new component of Visual C++.  It is a graphical, visual and interactive 
  586. program that encompasses the following three programming tasks:
  587.     *    User interface design and editing
  588.     *    Resource creation, editing and maintenance
  589.  
  590. App Studio uses a completely graphical approach to user interface design, and resource editing.
  591. Despite the visual approach to designing resources, all of the control normally provided through 
  592. the direct editing of resource files is still available in App Studio.  If desired, programmers can 
  593. always use the traditional method of directly editing resource files in the usual manner.
  594. Features
  595.     *    Suite of tools.  App Studio includes a dialog editor, graphics (bitmap, cursor, icon) 
  596. editor, symbol editor, string table editor, menu editor and accelerator table editor.
  597.     *    Completely integrated.  App Studio is fully integrated with both Visual 
  598. Workbench and Microsoft Foundation Class 2.0 (through ClassWizard).  At any 
  599. time, programmers editing code within Visual Workbench can start App Studio by 
  600. selecting it from the Visual Workbench menu bar.  Control is returned 
  601. automatically to Visual Workbench when resource editing is completed.
  602.     *    Resource browsing.  Allows you to view all resources associated with the 
  603. application, either in summary (list) form or in detail through any one of the 
  604. resource editors.
  605.     *    Simultaneous resource editing.  You can edit multiple resources at once in 
  606. different windows.  You can also open multiple resource files at the same time 
  607. and drag and drop resources to move or copy them between files.
  608.     *    Drag and drop.  App Studio supports a wide range of drag-and-drop operations 
  609. between resources that are being edited.
  610.     *    Automatic symbol management.  The symbol editor of App Studio lets you 
  611. name and rename resources with text names while numeric values are managed 
  612. automatically for you.  This makes managing symbols much faster and less 
  613. error-prone.
  614.     *    Modeless property sheets.  You can enter exact values for any object properties 
  615. (such as button style) by displaying that objectÆs property sheet. Property sheets 
  616. are modeless, and they dynamically update as you click on different items.  This 
  617. allows properties for all user interface elements to be set very quickly.
  618.     *    Edits multiple file types.  Programmers can directly edit a wide range of file 
  619. types, including .RC, .BMP, .ICO and .CUR.  Since it reads .RC files, it is 
  620. compatible with the command-line resource compiler of C/C++ 7.0 and the Win32 
  621. pre-release SDK.
  622. AppWizard
  623. AppWizard is a program that can be run as a standalone utility from Program Manager or 
  624. from Visual Workbench.  Its purpose is to create the "skeleton" application source code files 
  625. that give programmers a "jump start" into programming with Visual C++ and Microsoft 
  626. Foundation Class 2.0.
  627. Features
  628.     *    Creates Microsoft Foundation Class 2.0 applications.  Creates working 
  629. applications that contain Microsoft Foundation Class 2.0 functionality, including 
  630. printing and print preview, support for Visual Basic custom controls, documents and 
  631. views, multiple document applications, OLE support, context-sensitive help and 
  632. toolbar capabilities.  For programmers building a new application with Visual C++, 
  633. AppWizard is an indispensable tool for getting started with the new Microsoft 
  634. Foundation Class 2.0 features, such as the new document/view architecture.  And 
  635. AppWizard creates very little code since the implementation for core application 
  636. features is provided by the Microsoft Foundation Classes 2.0 class library.
  637.     *    Creates all project files.  AppWizard creates not just the source files, but all the 
  638. project files necessary to build the application immediately.
  639. ClassWizard
  640. ClassWizard is an important new tool that is the first of its kind.  It can best be described as a 
  641. "programmerÆs assistant" that helps developers with many of the details of C++ programming in 
  642. the Windows environment while enabling them to have full control over every line of their source 
  643. code.
  644. Programmers can use ClassWizard to connect user interface controls (such as dialog buttons) 
  645. to the application code that handles them.  This replaces the old method of tediously opening 
  646. and closing different source files to directly edit message maps, class declarations and dialog 
  647. data routines.  As a result, using ClassWizard is far more productive and less error-prone than 
  648. editing this type of code by hand, especially for large projects with dozens or hundreds of files.
  649. Features
  650.     *    Manage messages.  Allows programmers to map messages from Windows to 
  651. their function handlers.
  652.     *    Browse messages.  Allows programmers to quickly browse all the messages and 
  653. handler functions associated with user interface objects from a single location.  
  654. This is much faster than opening and scrolling through multiple source files.  
  655. Context-sensitive help on each message is available at any time.
  656.     *    Dialog data exchange and validation.  Programmers can take advantage of the 
  657. dialog data exchange (DDX) and dialog data validation (DDV) capabilities of 
  658. Microsoft Foundation Class 2.0.  ClassWizard maintains the relationship between 
  659. dialog controls and their member variables in the dialogÆs class.  For more 
  660. information on DDX and DDV, see the following section on Microsoft Foundation 
  661. Class 2.0.
  662.     *    Jump to code.  Programmers can jump directly to the correct source file to create 
  663. or edit the implementations of the message handler functions.  This is done 
  664. through seamless communication with the Visual Workbench editor.
  665.     *    Completely safe.  ClassWizard never changes any code written by programmers.  
  666. Whenever ClassWizard makes a change in a source file, it is only to sections of 
  667. code that are maintained by ClassWizard.  Since ClassWizard doesnÆt parse code 
  668. written by programmers, it is error-free and has none of the interpretation 
  669. problems inherent in code generators.
  670.     *    Completely integrated.  ClassWizard can be accessed from both Visual 
  671. Workbench and App Studio so you can edit class information at any time.
  672.     *    Imports existing projects.  In just a few steps, you can import existing Microsoft 
  673. Foundation Class 1.0 projects to make them compatible with ClassWizard.
  674. Microsoft Foundation Class Library Version 2.0
  675. Microsoft C/C++ 7 included the first version of the Microsoft Foundation Class library 
  676. (Microsoft Foundation Class 1.0), an extensive set of classes that encapsulated most of the 
  677. basic functionality of the Windows 3.1 SDK while providing higher-level classes that 
  678. simplified programming.  This class architecture, coupled with the internal mechanisms that 
  679. implement the classes is called the framework.
  680. In Visual C++ 32-bit Edition, the framework has been greatly enhanced through the 
  681. introduction of Microsoft Foundation Class version 2.0, which offers programmers a set of 
  682. higher level classes that simplify Windows and Windows NT-based programming.  Through 
  683. these classes, programmers are able to quickly create high-level objects that contain pre-built 
  684. application behavior.  For example, the new CFormView class allows programmers to build 
  685. form-processing applications by encapsulating the functionality of scrollable data entry forms. 
  686. Creating new forms requires almost no programming.  Normally, features such as this would 
  687. consume a considerable amount of development time.  Microsoft Foundation Class 2.0 
  688. applications written using Visual C++ 32-bit Edition can be compiled to run under either 
  689. Windows 3.1, using the Win32s API, or Windows NT, using the Win32 API.
  690. If desired, programmers can still continue to build any functionality they desire using standard 
  691. Win32 or Win32s SDK calls.  Microsoft Foundation Class 2.0 therefore gives programmers a 
  692. means of hiding the details of Windows-based development or fully exposing it, depending on 
  693. their needs.
  694. The following is a list of the major new classes and capabilities offered by Microsoft Foundation 
  695. Class 2.0:
  696. Features
  697.     *    Documents and views.  A document is an object with which the application user 
  698. interacts during an editing session, and is typically created by the New or Open 
  699. commands on the applicationÆs File menu.  Users interact with the data contained in a 
  700. document through a view object, which represents the client area of a frame window.
  701.         With the CDocument class, Microsoft Foundation Class 2.0 automatically 
  702. supports high-level commands such as File New, File Save, File Save As and File 
  703. Open.  Microsoft Foundation Class 2.0 does all the work of displaying a dialog to 
  704. gather information from the user and managing the disk file. 
  705.         Each document in a running application is attached to one or more views, which 
  706. control the graphical display of application data on the screen. Programmers will 
  707. typically derive a class from the Microsoft Foundation Class 2.0 CView class and 
  708. then implement the display code.  Once you implement drawing code within a 
  709. CView object, the framework will automatically provide device-independent 
  710. printing and print preview within your application.
  711.     *    Toolbar and status bar classes.  The new CToolbar class lets programmers easily 
  712. create toolbars that have a row of bitmapped buttons and optional separators.
  713.         The new CStatusBar class enables programmers to easily incorporate status bar 
  714. capabilities into their applications.  These include multiple paned bars that 
  715. separate information into groups and can be used to display almost any text such 
  716. as help messages or key state indicators.
  717.     *    Form and edit views.  CFormView provides form window capabilities for 
  718. applications that present a user interface based on a dialog template that contains 
  719. controls.  CEditView allows you to create views with text editing and scrolling 
  720. capabilities, and also supports printing, find and replace, cut, copy, paste and 
  721. undo, as well as standard File commands (Open, Save, Save As).
  722.     *    Scrolling and split-pane windows.  Derived from CView, the CScrollView class 
  723. provides documents with built-in scrolling capability, and CSplitterWnd splits 
  724. Windows into multiple panes.
  725.     *    OLE classes.  Three categories of classes are provided to support object linking 
  726. and embedding (OLE): OLE client classes, OLE server classes and an OLE 
  727. exception class.  These classes greatly simplify the work needed to implement 
  728. OLE capabilities in an application.
  729.         Microsoft Foundation Class 2.0 OLE support is tightly integrated with the 
  730. document/view and command architectures, so you can easily implement OLE 
  731. capabilities within objects belonging to the CDocument and CView classes.
  732.         The COleClientDoc and COleServerDoc classes allow programmers to create 
  733. document objects that support OLE client or server capabilities, while inheriting 
  734. all the features of the CDocument class.  The COleServerItem and 
  735. COleClientItem classes allow you to directly manipulate OLE items and manage 
  736. either the server or client side of an OLE connection.
  737.         Also included is the COleException class, which enables handling of failures that 
  738. occur during OLE processing.  This class can be used by both clients and servers.
  739.     *    Dialog data exchange and validation (DDX/DDV).  Dialog data 
  740. exchange/validation is a capability that allows data values entered into a dialog by the 
  741. application user to be automatically validated and assigned to a member variable.
  742.         Data from the dialogÆs member variables can be used to automatically initialize the 
  743. values of the dialogÆs control when the dialog is displayed.  You no longer have to 
  744. write code to assign initial values to the controls.
  745.         Also, data entered into a dialog by a user can be automatically assigned directly to 
  746. the dialogÆs member variables when the dialog exits.  You no longer have to write 
  747. a Get function to get the data and assign it to a variable.
  748.         Validating the data input to a dialog control can also be handled automatically. A 
  749. range of default validations (such as number of characters entered into an edit 
  750. box) are now performed automatically, and you can add custom validations to 
  751. build on the existing functionality.
  752.     *    Context-sensitive Help.  Microsoft Foundation Class 2.0 provides an 
  753. architecture that makes it easy to incorporate Help support in applications.  Help 
  754. support includes a Help menu with the standard commands, and a mechanism that 
  755. maps command or resource IDs to the various help contexts.  Help contexts are 
  756. easily created in Visual C++ because every time a user interface element is created 
  757. in App Studio, a help context for that element is automatically created.  When a 
  758. user presses the F1 key, Microsoft Foundation Class 2.0 automatically processes 
  759. the keystroke as a help request for the current command target.  
  760.     *    Compiler-independent.  Microsoft Foundation Class 2.0 source code is designed 
  761. to be compiler-independent, enabling Microsoft Foundation Class 2.0 applications 
  762. to be compiled with other standard C++ compilers.  Compiler vendors need only 
  763. supply a simple version header file (and possibly a version source file), and a 
  764. project file before Microsoft Foundation Class 2.0 applications can be compiled.
  765.  
  766. For more detailed information on Microsoft Foundation Class 2.0, see the white paper on this 
  767. subject.
  768. Compatibility of Visual C++ with Existing Tools
  769. Features
  770.     *    SDK compatibility.  Visual Workbench and App Studio are designed to work 
  771. with C++ programming as well as with C programming using the Win32 SDK, or 
  772. the Win32s SDK.  Programmers who want to program in C and work entirely 
  773. within one of the SDKs may do so.  The same benefits that Visual Workbench and 
  774. App Studio offer C++ programmers are also available to C developers.
  775.         If desired, programmers can mix and match Microsoft Foundation Class 2.0 code 
  776. with native Win32 or Win32s SDK calls, which makes it easy to gradually migrate 
  777. existing SDK-based code to Microsoft Foundation Class.
  778.         Since ClassWizard and AppWizard are tightly integrated with Microsoft 
  779. Foundation Class 2.0, these are not available to SDK programmers.
  780.     *    Microsoft Foundation Class 1.0 compatibility.  Projects created with Microsoft 
  781. Foundation Class 1.0 can easily be converted into the new Visual C++ project 
  782. format at any time.  Any source code written with Microsoft Foundation Class 1.0 
  783. can be rebuilt within Visual C++ with no problems.  To make Microsoft 
  784. Foundation Class 1.0 code work with ClassWizard, programmers must add a 
  785. small amount of code to their source files.  This involves placing simple C++ 
  786. comment delimiters around program statements that ClassWizard will maintain.
  787. Spy++ Analysis Tool
  788. Spy++ allows a developer to quickly discover a tremendous amount of information about his 
  789. or her Windows-based application.  The display of window messages shows decoded 
  790. parameters as well as return values.  Flexible "filters" allow precise control over the messages, 
  791. windows and other information displayed.  
  792.  
  793.  
  794. Figure 7.  SPY++
  795. To see Spy++ in action, start it and look at the Window, Process and Thread Tree views.  
  796. Clicking on a "plus" sign next to a window in the Window Tree view shows its child windows.  
  797. Double-click on a window name (the green color means that it is a hot-link) and you can open a 
  798. Window Details view of that window to see detailed information about it.  Double-click on the 
  799. displayed window class to open a Window Class Details view for the class.  Go back to the 
  800. Window Details view and notice that the process and thread for that window are shown.  
  801. Double-click on each of these to open a Process Details and Thread Details view for them.  
  802. Finally, go back to the Window Tree view and find a window for one of your running 
  803. applications, like Program Manager for instance.  Hold the Shift key down and double-click on 
  804. its window handle and you will open a Message Stream view for that window.  Run the mouse 
  805. over the Program Manager window to generate some messages that will be displayed complete 
  806. with return values and decoded parameters shown.  Use the View menu filter commands to 
  807. specify the messages, windows to include and output format of the display for the message 
  808. stream view.  If you are unsure of what a specific message is, just double-click on its name in 
  809. the message stream view and you will get full help on the message and its parameters.
  810. Technical Support for Developers
  811. Microsoft Product Support Services (PSS) provides support to individuals and organizations 
  812. through a variety of channels, which are described below.
  813.     *    Microsoft forums on CompuServe.  The MSLANG forum is provided via the 
  814. Microsoft Developer Services Area on CompuServe.  This forum provides easily 
  815. accessible, high-quality developer information through interactive dialog between 
  816. peer developers and Microsoft developer support engineers.  Also offered are 
  817. developer-specific Microsoft Knowledge Base articles, the Software Library and 
  818. query menus.  A "no charge" area for bug reports and product suggestions is 
  819. provided.
  820.     *    Microsoft download service.  Customers can use their own modems and 
  821. terminal emulation software to access application notes, printer drivers and 
  822. technical notes.  This service is for downloading only; sending and receiving 
  823. messages is supported through CompuServe forums.  The number for the 
  824. download service is (206) 936-6735.
  825.     *    Microsoft FastTips.  An interactive, automated touch-tone system providing 
  826. support at no additional charge, via toll lines.  It provides fast answers to 
  827. commonly asked questions, delivered to the customer by phone recording or fax.  
  828. It also includes a library of technical notes that are available by fax or mail.  
  829. FastTips is available seven days a week, 24 hours a day, including holidays.  The 
  830. FastTips number for Languages is (206) 635-4694.
  831.     *    Dedicated support numbers.  Direct lines to Microsoft product support personnel 
  832. via toll lines.  These support lines are designed to answer set-up, install and general 
  833. usage questions, and to receive product suggestions and bug reports.  Hours for 
  834. these lines are Monday through Friday, 6:00 a.m. to 6:00 p.m., Pacific time, 
  835. excluding holidays.  The number for Microsoft C/C++ products is (206) 635-7007.
  836.     *    TDD/TT (Text Telephone).  This service enables hearing-impaired users to 
  837. access the same phone support provided for all Microsoft products and support 
  838. levels.  Access requires a TT modem.  Available Monday through Friday,
  839. 6:00 a.m. to 6:00 p.m., Pacific time, excluding holidays.
  840.  
  841.  
  842.         Professional support.  This service is designed primarily for larger companies 
  843. seeking priority technical assistance on Microsoft products.  Direct contact with 
  844. senior Microsoft technical engineers is provided, along with guaranteed 24-hour 
  845. response time, a problem escalation process and other services.
  846.         Premier support.  The highest level of support, also designed for larger 
  847. companies.  Premier support includes individualized technical consulting, a 
  848. dedicated technical account manager, access to senior Microsoft technical 
  849. engineers, a response time of less than four hours and other services. 
  850.  
  851. For details on any of these services, call PSS sales at (800) 227-4679, extension 11700.
  852. Product Target
  853. Visual C++ 32-bit Edition is designed for experienced C++ programmers who want to create 
  854. powerful 32-bit applications for either Windows 3.1 using the Win32s API, or Windows NT using 
  855. the Win32 API.  It is the best choice for programmers who want their applications to run on the 
  856. next generation of 32-bit operating systems.  It includes complete software, documentation and 
  857. extensive sample code on CD-ROM.  Printed documentation may also be purchased additionally.
  858. The following table lists the major features of Visual C++ 32-bit Edition
  859. Feature
  860. 32-bit Edition
  861.  
  862. Visual Workbench
  863. *
  864.  
  865. App Studio, AppWizard, ClassWizard
  866. *
  867.  
  868. Microsoft Foundation Class 2.0
  869. *
  870.  
  871. Windows-based application development
  872. *
  873.  
  874. DLL development for Windows
  875. *
  876.  
  877. MFC and user guide samples 
  878. *
  879.  
  880. Optimizing compiler
  881. *
  882.  
  883. Complete Win32 and Win32s SDKs
  884. *
  885.  
  886. Develop 32-bit Applications for Windows 3.1
  887. *
  888.  
  889. Develop Applications for Windows NT
  890. *
  891.  
  892. Source profiler 
  893. *
  894.  
  895. Debugger support for Windows NT Exceptions
  896. *
  897.  
  898. Debugger support for threads
  899. *
  900.  
  901. New Spy++ enhanced spy utility
  902. *
  903.  
  904. Books Online
  905. *
  906.  
  907. Figure 8
  908.  
  909.  
  910. Availability, Pricing and Requirements
  911. The Visual C++ 32-bit Edition is scheduled to be available August 24, 1993 at a suggested 
  912. retail price of $599.  The system requirements are as follows:
  913.     *    An IBM*-compatible personal computer running Windows NT 3.1
  914.     *    An Intel* 80386 or higher processor
  915.     *    16MB of available RAM (20MB recommended)
  916.     *    One CD-ROM drive supported by Windows NT
  917.     *    A hard disk with enough disk space to install the options needed.  6MB of 
  918. available storage space is the minimum requirement to run your installation from 
  919. the CD-ROM.  To install the full configuration of the 32-bit Edition, 80MB of 
  920. free disk space is required.
  921.     *    A VGA (or higher resolution) adapter and monitor
  922.     *    A mouse or other pointing device supported by Windows NT
  923.  
  924.  
  925. Appendix B:  An Exercise with Visual C++
  926. The exercise in this Appendix gives you a brief tour of some of the components of Microsoft 
  927. Visual C++.  The goal is to demonstrate how quickly you can get started programming for 
  928. Windows with C++ and Microsoft Foundation Class 2.0.  This is not a comprehensive 
  929. exercise that demonstrates all the features of the product, but is intended to show how Visual 
  930. C++ allows you to quickly build C++-based applications for the Windows environment.
  931. To perform this exercise, you must first install the Visual C++ 32-bit Edition on your 
  932. computer.  See the end of Appendix A for a list of system requirements.
  933. Step 1:  Create a Skeleton Application
  934. In Program Manager, click the Visual Workbench icon in the Visual C++ group.  From the 
  935. Visual Workbench Project menu, select AppWizard, then enter a project name (for this 
  936. example use "COOL").  Enter a project directory if you wish to put the project in a different 
  937. location.  You can do this using the directory browser in the dialog.
  938. Click the OK button.  YouÆll be presented with a confirmation dialog that lists the major 
  939. features of your new COOL application.  Click the Create button, and a Visual C++ project 
  940. will be created for you.  This project contains the files and declarations common to every 
  941. standard Microsoft Foundation Class 2.0 application. 
  942. Unlike a code generator or a CASE tool, the skeleton application relies on the reusable code 
  943. in the Microsoft Foundation Class 2.0 application framework to do most of the work.  WeÆll 
  944. look at these files in a moment.  At this point, you can view the various features for your 
  945. application using the Options and Classes buttons.  Feel free to browse them, but for this 
  946. exercise weÆll demonstrate the power of Microsoft Foundation Class 2.0 and Visual C++ 
  947. without adjusting them.  
  948. Step 2:  Compile the Application
  949. Click the Build button on the Visual Workbench toolbar (the one with the two 
  950. downward-pointing arrows).  While this project is building (it should take about 90 seconds 
  951. on a standard 486/33-class machine) you can look at the source files in your project.  Since 
  952. Visual C++ allows you to continue editing while building, you donÆt have to wait for the build 
  953. to finish.
  954. To view the project source files, click the Project File button (the leftmost button) on the 
  955. toolbar.  Open MAINFRM.H, which contains the declaration for the main window of the 
  956. application.  As you can see, this declaration is just a class derived from the built-in Microsoft 
  957. Foundation Class 2.0 class CMDIFrameWnd.  Also notice the syntax coloring supported by 
  958. the Visual Workbench editor, which makes your code more readable.
  959. As you scroll downward through the file, you will see that the declaration is commented and 
  960. documented.  The class contains two member variables:  one for the applicationÆs toolbar and 
  961. one for its status bar.  These variables use the two Microsoft Foundation Class 2.0 classes 
  962. CToolBar and CStatusBar.
  963. Now open COOL.CPP, which implements the application initialization code.  Scrolling 
  964. downward through the file, look for the InitInstance function which initializes many features 
  965. of the application.  For example, the LoadStdProfileSettings call automatically loads the most 
  966. recently used file list in the File menu.  The OnFileNew call creates an empty document for 
  967. users of the application.  The important point to note here (and in the rest of this exercise) is 
  968. that there is very little user-written code in this application, despite the large amount of 
  969. functionality.  Most of the statements are simply class declarations and function stubs ╛ all of 
  970. the reusable code is in the Microsoft Foundation Class 2.0 library.
  971. Step 3:  Execute COOL.EXE
  972. From the Project menu, select the Execute command (or press Ctrl+F5) to run COOL.EXE.  
  973. Although youÆve written no code, you have a complete Microsoft Foundation Class 2.0 C++ 
  974. application for Windows that contains the following features: 
  975.     *    An MDI application (SDI is optional)
  976.     *    A toolbar with buttons that map to the menu commands File New, File Open, File 
  977. Save, Edit Cut, Edit Copy, Edit Paste, File Print, and Help About
  978.     *    A status bar with menu command prompt strings for all commands, and indicators 
  979. for Num Lock, Scroll Lock and Caps Lock keys
  980.     *    File menu commands for New, Open, Close, Save, Save As, Print, Print Preview, 
  981. Print Setup, recent file list, and Exit
  982.     *    Standard dialog support for obtaining file name information from the user 
  983. (through the Open and Save As commands on the File menu)
  984.     *    Standard dialog support for print and print setup
  985.     *    Print preview support, including Next/Prev Page, Two Page view, and Zoom In/Out
  986.     *    Edit menu hooks for Undo, Cut, Copy, Paste
  987.     *    View menu to enable or disable the toolbar and/or status bar
  988.     *    Window menu commands New Window (that correctly names each window by 
  989. appending a numeric index), Cascade, Tile, Arrange Icons, and an active window 
  990. list
  991.  
  992. Some of these features require you to write a small amount of additional code before they are 
  993. fully enabled.  For example, select the File Open command and youÆll see that it requires you to 
  994. add a small amount of code to read the data.  However, notice that the most recently used list in 
  995. the File menu is updated, and that multiple MDI child windows are automatically displayed with 
  996. the correct title as you open files.  There is even a default icon for documents when you minimize 
  997. child windows.  All of this functionality is handled by Microsoft Foundation Class 2.0, without 
  998. requiring you to write any code.
  999. Similarly, the File Save (and Save As) commands create a new file for you, but donÆt write 
  1000. anything to disk until you add application-specific code (which is added to COOLDOC.CPPÆs 
  1001. Serialize member function).  Also notice that the Edit menu commands (and the accompanying 
  1002. toolbar buttons) are disabled because no code has been written to handle the Clipboard.  
  1003. However, many of these functions are fairly simple to write, and you can have a fully functional 
  1004. basic application for Windows that supports all of the above features with just a small amount 
  1005. additional work.
  1006. Now exit the COOL application (be sure to exit COOL by using the File Exit command).
  1007. Step 4:  Edit COOLÆs Windows Resources
  1008. Open the projectÆs resource file by choosing App Studio in the Tools menu. This automatically 
  1009. starts App Studio, the integrated resource editor, and loads the projects resource file 
  1010. (COOL.RC).  App Studio is a full-featured resource editor that lets you edit all of the standard 
  1011. resources of Windows 3.1 cursors, icons, bitmaps, accelerator tables, string tables and dialogs.
  1012. Select the Icon resource type to display a list of all the icon resources in the COOL project, 
  1013. then double-click the IDR_COOLTYPE icon.  This is the icon that is used for minimized MDI 
  1014. documents.  The App Studio graphics editor is started, and you can edit the icon any way you 
  1015. like.  You might try clicking on a contrasting color and use the Fill Tool (the "paint can") to 
  1016. change the background color.
  1017. Now return to Visual Workbench by pressing Alt+Tab, or click on the Visual Workbench 
  1018. window if it is visible.
  1019. Step 5:  Add Some Drawing Code
  1020. Using the Project File list, open COOLVIEW.CPP, which contains the code for the applicationÆs 
  1021. "view."  The view is the window that displays the visible portion of the current document. 
  1022. Scroll down the COOLVIEW.CPP file until you see the OnDraw member function.  This 
  1023. function is the abstract device-independent drawing routine used by the framework.  Completing 
  1024. this code automatically gives your application support for printing, print preview and standard 
  1025. drawing.
  1026. Replace the "TODO" comment with the following lines:
  1027. CString str = "Hello World";
  1028. pDC->TextOut(20, 20, str);
  1029.  
  1030. CString is a dynamic string class in Microsoft Foundation Class 2.0.  The parameters to 
  1031. TextOut are the coordinates to draw the string and the string itself.
  1032. Step 6:  Use ClassWizard to Connect Messages to Code
  1033. Select the ClassWizard item on the Browse menu command (Ctrl+W).  This launches 
  1034. ClassWizard, a tool that enables you to connect user interface elements and messages to code, 
  1035. create new C++ visual classes, and manage dialog data exchange and validation (DDX/DDV).
  1036. Select the CCoolView class from the Class Name dropdown list, then choose CCoolView 
  1037. from the Object IDs list (this contains all of the various visual objects you can connect).
  1038. Select WM_SETCURSOR from the Messages list, which contains all the messages to which 
  1039. you can connect the selected visual object.  In this case, CCoolView is a standard window so 
  1040. you see all messages appropriate for a window.  If you are not sure what a message does, 
  1041. select the message and press F1 to display context-sensitive help on the message handler in 
  1042. Microsoft Foundation Class 2.0.
  1043. Now click Add Function (or double-click WM_SETCURSOR).  This creates a new message 
  1044. handler for the message.  If you are familiar with Microsoft Foundation Class 1.0, this is 
  1045. equivalent to automatically adding the function to the message map.
  1046. Now click Edit Code, and you are taken to the appropriate place in the implementation file to 
  1047. add code for this message.  This is very similar to Visual Basic, because you have gone from a 
  1048. message (an event in Visual Basic) to the code that is specialized for your application.
  1049. In the source file, replace the "return" statement and TODO comment, with the following two 
  1050. lines:
  1051. SetCursor(LoadCursor(NULL, IDC_CROSS));
  1052. return TRUE;
  1053.  
  1054. Now, whenever the cursor is positioned over one of our views it will appear as a cross hair.
  1055. Note how ClassWizard helped you manage your classes from a single location, which makes it 
  1056. easier to visualize your applicationÆs classes, the messages they respond to, and the code that 
  1057. handles the messages.
  1058. Step 7:  Connect User Interface Elements to Code
  1059. Remember that the Edit menu commands were all disabled when you first ran the application 
  1060. because no user code was written to handle the commands, and a default implementation was 
  1061. not provided by the application framework (because the Clipboard is application-specific).
  1062. Press Ctrl+W to once again display ClassWizard.  Notice that the CCoolView class is already 
  1063. selected, because ClassWizard remembered where you left off.  For the object ID, select the 
  1064. ID_EDIT_COPY user interface element.  This represents the command for both the menu and 
  1065. the toolbar button.  Double-click the COMMAND message to handle the command.  
  1066. ClassWizard suggests a function name, which you can accept.  Note that the 
  1067. UPDATE_COMMAND_UI is also sent by the application framework and can be used to 
  1068. dynamically update menu items and/or toolbar buttons (e.g., enable or disable), depending on 
  1069. the state of your application.
  1070. Click Edit Code, which takes you directly to the code for handling the message.  However, 
  1071. you donÆt need to add any code, since the framework now knows that your application is 
  1072. handling the message, so it enables the menu command and toolbar button.
  1073. Step 8:  Run the Application
  1074. Run the application using the Project Execute command (Ctrl+F5).  YouÆll be asked if you 
  1075. want to rebuild the project, so click Yes.  Notice that all the files are saved for you, even the 
  1076. resource script, so thereÆs no chance of losing any information.
  1077. When the application is displayed, notice that the cursor is a cross hair when positioned over a 
  1078. child window.  Minimize a child window to see the new icon.
  1079. Notice that the Edit Copy menu item and toolbar button are now enabled, and that the text 
  1080. "Hello World" is in your view.  Select Print Preview, which allows you to preview you 
  1081. document before printing.  (Depending on the printer you have selected for your machine, you 
  1082. might need to Zoom In on the page to see the text clearly.)  If you like, you can print your 
  1083. document because printing is fully enabled.  With almost no effort, full Print Preview and 
  1084. Printing are already implemented for your application, allowing you to focus on more 
  1085. application-specific code.  The Microsoft Foundation Class 2.0 Print Preview even maps the 
  1086. system font to an appropriate font on your selected printer.
  1087. Step 9:  Continue to Explore
  1088. By now, it should be evident how Visual C++ can speed development of applications for the 
  1089. Windows operating system by supplying much of the functionality for you through Microsoft 
  1090. Foundation Class 2.0, and by providing a set of integrated tools that do much of the work for 
  1091. you.  Although youÆve written only a few lines of code, your application has a large amount of 
  1092. ready-to-run functionality.
  1093. If you want to continue exploring on your own, you can add a menu item or a  dialog, and 
  1094. explore compiler options (such as RETAIL) to see that the retail version of this application is 
  1095. smaller than 90K, despite the large amount of functionality.  For more information on how to 
  1096. do this, see the Visual C++ Class Libraries UserÆs Guide.
  1097. #########
  1098. Microsoft, MS-DOS and CodeView are registered trademarks and Windows, Visual Basic, Visual C++, Win32, Win32s and 
  1099. Windows NT are trademarks of Microsoft Corporation.  
  1100. CompuServe is a registered trademark of CompuServe, Inc.  
  1101. Intel is a registered trademark and i486 and Pentium are trademarks of Intel Corporation.
  1102. IBM is a registered trademark of International Business Machines Corporation.
  1103. Prices listed are U.S. suggested retail price.  Reseller price may vary.
  1104.  
  1105. The information contained in this document represents the current view of Microsoft Corporation on the issues 
  1106. discussed as of the date of publication.  Because Microsoft must respond to changing market conditions, it 
  1107. should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the 
  1108. accuracy of any information presented after the date of publication.
  1109.  
  1110. This document is for informational purposes only.  
  1111.  
  1112. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT.
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119. - more -
  1120.  
  1121. Microsoft Visual C++ 32-bit Edition Version 1.0 Product Overview    Page 12
  1122.  
  1123. - more -
  1124.  
  1125. Microsoft Visual C++ 32-bit Edition Version 1.0 Product Overview    Page A-10
  1126.  
  1127. Microsoft Visual C++ 32-bit Edition Version 1.0 Product Overview    Page B-5
  1128.  
  1129.  
  1130.